﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="demoWS.aspx.cs" Inherits="WebService_demoWS" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:ScriptManager 
        ID="sm" 
        runat="server">
        <Services>
          <asp:ServiceReference 
            Path="~/WebService/simpleWS.asmx"/>
          <asp:ServiceReference InlineScript="false"
            Path="http://localhost/externalWS/ws01.asmx" />
        </Services>
      </asp:ScriptManager>
      
      
      <asp:Label 
        ID="internal_ws_codebehide"
        Text="Internal Web Service in codebehide"  
        runat="server" />
      <asp:Label 
        ID="internal_ws_val_codebehide"
        Text=""  
        runat="server" />
      
      <br />
      
      <asp:Label 
        ID="external_ws_codebehide"
        Text="external Web Service in codebehide"  
        runat="server" />
      <asp:Label 
        ID="external_ws_val_codebehide"
        Text=""  
        runat="server" />      
        
      <br />

      <asp:Label 
        ID="internal_ws"
        Text="Internal Web Service"  
        runat="server" />
      <asp:Label 
        ID="internal_ws_val"
        Text=""  
        runat="server" />
     
      <br />
        
      <asp:Label 
        ID="external_ws"
        Text="External Web Service"  
        runat="server" />
      <asp:Label 
        ID="external_ws_val"
        Text=""  
        runat="server" />
     
      <br />
              
      <script type="text/javascript">
        $(function() {
          simpleWS.HelloWorld(internal_ws_onSuccess);
          function internal_ws_onSuccess(result) {
            $('#internal_ws_val').text(result);
          }

          


          

        });

        function DoClick() {
          ws01.HelloWorld(external_ws_onSuccess);
          function external_ws_onSuccess(result) {
            $('#external_ws_val').text(result);
          }
        }
        
      </script>      
      
       <asp:Button 
        ID="btn" 
        OnClientClick="DoClick();" 
        runat="server" />       
       
    </div>
    </form>
</body>
</html>
